﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Maestro.master" AutoEventWireup="true" CodeFile="Fotos.aspx.cs" Inherits="Fotos" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dxuc" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxHiddenField" TagPrefix="dxhf" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dxtc" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dxw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxRoundPanel" tagprefix="dxrp" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dxp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
                                        </asp:ScriptManager>
   
                                <table cellpadding="0" cellspacing="0" 
        align="center" style="border: thin solid #C0C0C0">
                                <tr>
                                    <td colspan = "4" align="center" bgcolor="White">
                                        
                                        &nbsp;</td>
                                </tr>
                                            <tr bgcolor="White">
                                                <td>
                                                     &nbsp; &nbsp; &nbsp;&nbsp;
                                                </td>
                                                <td class="caption" valign="top">
                                                    <dxe:ASPxLabel ID="lblSelectImage" runat="server" Text="Seleccione los archivos:" AssociatedControlID="uplImage">
                                                    </dxe:ASPxLabel>
                                                </td>
                                                <td valign="top">
                                                    <dxuc:ASPxUploadControl ID="UploadControl" runat="server" 
                                                        ShowAddRemoveButtons="True" ClientInstanceName="UploadControl"
                                                        ShowUploadButton="True" AddUploadButtonsHorizontalPosition="Left" ShowProgressPanel="True"
                                                        OnFileUploadComplete="UploadControl_FileUploadComplete" FileInputCount="3"
                                                        Size="35">
                                                         <ValidationSettings MaxFileSize="4000000" AllowedContentTypes="image/jpeg, image/gif, image/pjpeg" >
                                                            </ValidationSettings>                                                          
                                                         <AddButton Text="Agregar">
                                                         </AddButton>
                                                         <RemoveButton Text="Quitar">
                                                         </RemoveButton>
                                                         <UploadButton Text="Subir">
                                                         </UploadButton>
                                                         <CancelButton Text="Cancelar">
                                                         </CancelButton>
                                                    </dxuc:ASPxUploadControl>
                                                </td>
                                                <td>
                                                     &nbsp; &nbsp; &nbsp;&nbsp;
                                                </td>
                                            </tr>
                                            <tr style="background-color: #FFFFFF">
                                                <td colspan="4">
                                                    &nbsp;
                                                </td>
                                                    
                                            </tr>
                                        </table>
                            </br>    
                            <table align="center" >
                                <tr>
                                    <td align="center" bgcolor="White">
                                        <asp:UpdatePanel ID="UpdatePanelFotos" runat="server">
                                            <ContentTemplate>
                                                <asp:GridView ID="gvFotos" runat="server" AutoGenerateColumns="False" 
                                                    DataKeyNames="Nombre,NombreArchivo,Carpeta,Uri,RutaFisica" 
                                                    DataSourceID="dsFotos" ShowHeader="False" BorderStyle="Outset" 
                                                    HorizontalAlign="Center">
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Fotos" SortExpression="Nombre">
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Nombre") %>'></asp:TextBox>
                                                            </EditItemTemplate>
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblNombre" runat="server" Text='<%# Bind("Nombre") %>'></asp:Label>
                                                                &nbsp;<asp:LinkButton ID="btnEliminar" runat="server" CommandName="Delete" 
                                                                    onclientclick="return confirm('¿Esta seguro?')">Eliminar</asp:LinkButton>
                                                                <br />
                                                                <asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("Uri") %>' />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <EmptyDataTemplate>
                                                        <table>
                                                            <tr>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="center" width="440">
                                                                    <b>No se encontraron fotos</b>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </EmptyDataTemplate>
                                                </asp:GridView>
                                                <asp:ObjectDataSource ID="dsFotos" runat="server" 
                                                    DataObjectTypeName="SGT_ON.ONFoto" DeleteMethod="Eliminar" 
                                                    OldValuesParameterFormatString="original_{0}" OnSelecting="dsFotos_Selecting" 
                                                    SelectMethod="ObtenerColeccionDeFotos" TypeName="SGT_ON.ONFotoColeccion">
                                                    <SelectParameters>
                                                        <asp:Parameter DefaultValue="-1" Name="pID" Type="Int32" />
                                                        <asp:Parameter DefaultValue="" Name="pCarpeta" Type="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                            </table>
                           
</asp:Content>

